﻿#region Using directives

using System;
using System.Data;
using System.Data.Common;
using System.Collections;
using System.Collections.Generic;

using PAT.Entities;
using PAT.Data;

#endregion

namespace PAT.Data.Bases
{	
	///<summary>
	/// This class is the base class for any <see cref="PatItemInventarioProviderBase"/> implementation.
	/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
	///</summary>
	public abstract partial class PatItemInventarioProviderBaseCore : EntityProviderBase<PAT.Entities.PatItemInventario, PAT.Entities.PatItemInventarioKey>
	{		
		#region Get from Many To Many Relationship Functions
		#region GetByIdCatalogoFromPatItemCatalogo
		
		/// <summary>
		///		Gets PAT_ITEM_INVENTARIO objects from the datasource by ID_CATALOGO in the
		///		PAT_ITEM_CATALOGO table. Table PAT_ITEM_INVENTARIO is related to table PAT_CATALOGO_VEHICULO
		///		through the (M:N) relationship defined in the PAT_ITEM_CATALOGO table.
		/// </summary>
		/// <param name="_idCatalogo"></param>
		/// <returns>Returns a typed collection of PatItemInventario objects.</returns>
		public TList<PatItemInventario> GetByIdCatalogoFromPatItemCatalogo(System.Int32 _idCatalogo)
		{
			int count = -1;
			return GetByIdCatalogoFromPatItemCatalogo(null,_idCatalogo, 0, int.MaxValue, out count);
			
		}
		
		/// <summary>
		///		Gets PAT.Entities.PatItemInventario objects from the datasource by ID_CATALOGO in the
		///		PAT_ITEM_CATALOGO table. Table PAT_ITEM_INVENTARIO is related to table PAT_CATALOGO_VEHICULO
		///		through the (M:N) relationship defined in the PAT_ITEM_CATALOGO table.
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_idCatalogo"></param>
		/// <remarks></remarks>
		/// <returns>Returns a TList of PatItemInventario objects.</returns>
		public TList<PatItemInventario> GetByIdCatalogoFromPatItemCatalogo(System.Int32 _idCatalogo, int start, int pageLength)
		{
			int count = -1;
			return GetByIdCatalogoFromPatItemCatalogo(null, _idCatalogo, start, pageLength, out count);
		}
		
		/// <summary>
		///		Gets PatItemInventario objects from the datasource by ID_CATALOGO in the
		///		PAT_ITEM_CATALOGO table. Table PAT_ITEM_INVENTARIO is related to table PAT_CATALOGO_VEHICULO
		///		through the (M:N) relationship defined in the PAT_ITEM_CATALOGO table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idCatalogo"></param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT_ITEM_INVENTARIO objects.</returns>
		public TList<PatItemInventario> GetByIdCatalogoFromPatItemCatalogo(TransactionManager transactionManager, System.Int32 _idCatalogo)
		{
			int count = -1;
			return GetByIdCatalogoFromPatItemCatalogo(transactionManager, _idCatalogo, 0, int.MaxValue, out count);
		}
		
		
		/// <summary>
		///		Gets PatItemInventario objects from the datasource by ID_CATALOGO in the
		///		PAT_ITEM_CATALOGO table. Table PAT_ITEM_INVENTARIO is related to table PAT_CATALOGO_VEHICULO
		///		through the (M:N) relationship defined in the PAT_ITEM_CATALOGO table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idCatalogo"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT_ITEM_INVENTARIO objects.</returns>
		public TList<PatItemInventario> GetByIdCatalogoFromPatItemCatalogo(TransactionManager transactionManager, System.Int32 _idCatalogo,int start, int pageLength)
		{
			int count = -1;
			return GetByIdCatalogoFromPatItemCatalogo(transactionManager, _idCatalogo, start, pageLength, out count);
		}
		
		/// <summary>
		///		Gets PatItemInventario objects from the datasource by ID_CATALOGO in the
		///		PAT_ITEM_CATALOGO table. Table PAT_ITEM_INVENTARIO is related to table PAT_CATALOGO_VEHICULO
		///		through the (M:N) relationship defined in the PAT_ITEM_CATALOGO table.
		/// </summary>
		/// <param name="_idCatalogo"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT_ITEM_INVENTARIO objects.</returns>
		public TList<PatItemInventario> GetByIdCatalogoFromPatItemCatalogo(System.Int32 _idCatalogo,int start, int pageLength, out int count)
		{
			
			return GetByIdCatalogoFromPatItemCatalogo(null, _idCatalogo, start, pageLength, out count);
		}


		/// <summary>
		///		Gets PAT_ITEM_INVENTARIO objects from the datasource by ID_CATALOGO in the
		///		PAT_ITEM_CATALOGO table. Table PAT_ITEM_INVENTARIO is related to table PAT_CATALOGO_VEHICULO
		///		through the (M:N) relationship defined in the PAT_ITEM_CATALOGO table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <param name="_idCatalogo"></param>
		/// <remarks></remarks>
		/// <returns>Returns a TList of PatItemInventario objects.</returns>
		public abstract TList<PatItemInventario> GetByIdCatalogoFromPatItemCatalogo(TransactionManager transactionManager,System.Int32 _idCatalogo, int start, int pageLength, out int count);
		
		#endregion GetByIdCatalogoFromPatItemCatalogo
		
		#region GetByIdGrupoCatalogoFromPatItemGrupo
		
		/// <summary>
		///		Gets PAT_ITEM_INVENTARIO objects from the datasource by ID_GRUPO_CATALOGO in the
		///		PAT_ITEM_GRUPO table. Table PAT_ITEM_INVENTARIO is related to table PAT_GRUPO_CATALOGO
		///		through the (M:N) relationship defined in the PAT_ITEM_GRUPO table.
		/// </summary>
		/// <param name="_idGrupoCatalogo"></param>
		/// <returns>Returns a typed collection of PatItemInventario objects.</returns>
		public TList<PatItemInventario> GetByIdGrupoCatalogoFromPatItemGrupo(System.Int16 _idGrupoCatalogo)
		{
			int count = -1;
			return GetByIdGrupoCatalogoFromPatItemGrupo(null,_idGrupoCatalogo, 0, int.MaxValue, out count);
			
		}
		
		/// <summary>
		///		Gets PAT.Entities.PatItemInventario objects from the datasource by ID_GRUPO_CATALOGO in the
		///		PAT_ITEM_GRUPO table. Table PAT_ITEM_INVENTARIO is related to table PAT_GRUPO_CATALOGO
		///		through the (M:N) relationship defined in the PAT_ITEM_GRUPO table.
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_idGrupoCatalogo"></param>
		/// <remarks></remarks>
		/// <returns>Returns a TList of PatItemInventario objects.</returns>
		public TList<PatItemInventario> GetByIdGrupoCatalogoFromPatItemGrupo(System.Int16 _idGrupoCatalogo, int start, int pageLength)
		{
			int count = -1;
			return GetByIdGrupoCatalogoFromPatItemGrupo(null, _idGrupoCatalogo, start, pageLength, out count);
		}
		
		/// <summary>
		///		Gets PatItemInventario objects from the datasource by ID_GRUPO_CATALOGO in the
		///		PAT_ITEM_GRUPO table. Table PAT_ITEM_INVENTARIO is related to table PAT_GRUPO_CATALOGO
		///		through the (M:N) relationship defined in the PAT_ITEM_GRUPO table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idGrupoCatalogo"></param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT_ITEM_INVENTARIO objects.</returns>
		public TList<PatItemInventario> GetByIdGrupoCatalogoFromPatItemGrupo(TransactionManager transactionManager, System.Int16 _idGrupoCatalogo)
		{
			int count = -1;
			return GetByIdGrupoCatalogoFromPatItemGrupo(transactionManager, _idGrupoCatalogo, 0, int.MaxValue, out count);
		}
		
		
		/// <summary>
		///		Gets PatItemInventario objects from the datasource by ID_GRUPO_CATALOGO in the
		///		PAT_ITEM_GRUPO table. Table PAT_ITEM_INVENTARIO is related to table PAT_GRUPO_CATALOGO
		///		through the (M:N) relationship defined in the PAT_ITEM_GRUPO table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idGrupoCatalogo"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT_ITEM_INVENTARIO objects.</returns>
		public TList<PatItemInventario> GetByIdGrupoCatalogoFromPatItemGrupo(TransactionManager transactionManager, System.Int16 _idGrupoCatalogo,int start, int pageLength)
		{
			int count = -1;
			return GetByIdGrupoCatalogoFromPatItemGrupo(transactionManager, _idGrupoCatalogo, start, pageLength, out count);
		}
		
		/// <summary>
		///		Gets PatItemInventario objects from the datasource by ID_GRUPO_CATALOGO in the
		///		PAT_ITEM_GRUPO table. Table PAT_ITEM_INVENTARIO is related to table PAT_GRUPO_CATALOGO
		///		through the (M:N) relationship defined in the PAT_ITEM_GRUPO table.
		/// </summary>
		/// <param name="_idGrupoCatalogo"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT_ITEM_INVENTARIO objects.</returns>
		public TList<PatItemInventario> GetByIdGrupoCatalogoFromPatItemGrupo(System.Int16 _idGrupoCatalogo,int start, int pageLength, out int count)
		{
			
			return GetByIdGrupoCatalogoFromPatItemGrupo(null, _idGrupoCatalogo, start, pageLength, out count);
		}


		/// <summary>
		///		Gets PAT_ITEM_INVENTARIO objects from the datasource by ID_GRUPO_CATALOGO in the
		///		PAT_ITEM_GRUPO table. Table PAT_ITEM_INVENTARIO is related to table PAT_GRUPO_CATALOGO
		///		through the (M:N) relationship defined in the PAT_ITEM_GRUPO table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <param name="_idGrupoCatalogo"></param>
		/// <remarks></remarks>
		/// <returns>Returns a TList of PatItemInventario objects.</returns>
		public abstract TList<PatItemInventario> GetByIdGrupoCatalogoFromPatItemGrupo(TransactionManager transactionManager,System.Int16 _idGrupoCatalogo, int start, int pageLength, out int count);
		
		#endregion GetByIdGrupoCatalogoFromPatItemGrupo
		
		#region GetByIdListaPreciosItemFromPatItemInventarioListaPrecios
		
		/// <summary>
		///		Gets PAT_ITEM_INVENTARIO objects from the datasource by ID_LISTA_PRECIOS_ITEM in the
		///		PAT_ITEM_INVENTARIO_LISTA_PRECIOS table. Table PAT_ITEM_INVENTARIO is related to table PAT_ITEM_LISTA_PRECIOS
		///		through the (M:N) relationship defined in the PAT_ITEM_INVENTARIO_LISTA_PRECIOS table.
		/// </summary>
		/// <param name="_idListaPreciosItem"></param>
		/// <returns>Returns a typed collection of PatItemInventario objects.</returns>
		public TList<PatItemInventario> GetByIdListaPreciosItemFromPatItemInventarioListaPrecios(System.Byte _idListaPreciosItem)
		{
			int count = -1;
			return GetByIdListaPreciosItemFromPatItemInventarioListaPrecios(null,_idListaPreciosItem, 0, int.MaxValue, out count);
			
		}
		
		/// <summary>
		///		Gets PAT.Entities.PatItemInventario objects from the datasource by ID_LISTA_PRECIOS_ITEM in the
		///		PAT_ITEM_INVENTARIO_LISTA_PRECIOS table. Table PAT_ITEM_INVENTARIO is related to table PAT_ITEM_LISTA_PRECIOS
		///		through the (M:N) relationship defined in the PAT_ITEM_INVENTARIO_LISTA_PRECIOS table.
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_idListaPreciosItem"></param>
		/// <remarks></remarks>
		/// <returns>Returns a TList of PatItemInventario objects.</returns>
		public TList<PatItemInventario> GetByIdListaPreciosItemFromPatItemInventarioListaPrecios(System.Byte _idListaPreciosItem, int start, int pageLength)
		{
			int count = -1;
			return GetByIdListaPreciosItemFromPatItemInventarioListaPrecios(null, _idListaPreciosItem, start, pageLength, out count);
		}
		
		/// <summary>
		///		Gets PatItemInventario objects from the datasource by ID_LISTA_PRECIOS_ITEM in the
		///		PAT_ITEM_INVENTARIO_LISTA_PRECIOS table. Table PAT_ITEM_INVENTARIO is related to table PAT_ITEM_LISTA_PRECIOS
		///		through the (M:N) relationship defined in the PAT_ITEM_INVENTARIO_LISTA_PRECIOS table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idListaPreciosItem"></param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT_ITEM_INVENTARIO objects.</returns>
		public TList<PatItemInventario> GetByIdListaPreciosItemFromPatItemInventarioListaPrecios(TransactionManager transactionManager, System.Byte _idListaPreciosItem)
		{
			int count = -1;
			return GetByIdListaPreciosItemFromPatItemInventarioListaPrecios(transactionManager, _idListaPreciosItem, 0, int.MaxValue, out count);
		}
		
		
		/// <summary>
		///		Gets PatItemInventario objects from the datasource by ID_LISTA_PRECIOS_ITEM in the
		///		PAT_ITEM_INVENTARIO_LISTA_PRECIOS table. Table PAT_ITEM_INVENTARIO is related to table PAT_ITEM_LISTA_PRECIOS
		///		through the (M:N) relationship defined in the PAT_ITEM_INVENTARIO_LISTA_PRECIOS table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idListaPreciosItem"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT_ITEM_INVENTARIO objects.</returns>
		public TList<PatItemInventario> GetByIdListaPreciosItemFromPatItemInventarioListaPrecios(TransactionManager transactionManager, System.Byte _idListaPreciosItem,int start, int pageLength)
		{
			int count = -1;
			return GetByIdListaPreciosItemFromPatItemInventarioListaPrecios(transactionManager, _idListaPreciosItem, start, pageLength, out count);
		}
		
		/// <summary>
		///		Gets PatItemInventario objects from the datasource by ID_LISTA_PRECIOS_ITEM in the
		///		PAT_ITEM_INVENTARIO_LISTA_PRECIOS table. Table PAT_ITEM_INVENTARIO is related to table PAT_ITEM_LISTA_PRECIOS
		///		through the (M:N) relationship defined in the PAT_ITEM_INVENTARIO_LISTA_PRECIOS table.
		/// </summary>
		/// <param name="_idListaPreciosItem"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT_ITEM_INVENTARIO objects.</returns>
		public TList<PatItemInventario> GetByIdListaPreciosItemFromPatItemInventarioListaPrecios(System.Byte _idListaPreciosItem,int start, int pageLength, out int count)
		{
			
			return GetByIdListaPreciosItemFromPatItemInventarioListaPrecios(null, _idListaPreciosItem, start, pageLength, out count);
		}


		/// <summary>
		///		Gets PAT_ITEM_INVENTARIO objects from the datasource by ID_LISTA_PRECIOS_ITEM in the
		///		PAT_ITEM_INVENTARIO_LISTA_PRECIOS table. Table PAT_ITEM_INVENTARIO is related to table PAT_ITEM_LISTA_PRECIOS
		///		through the (M:N) relationship defined in the PAT_ITEM_INVENTARIO_LISTA_PRECIOS table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <param name="_idListaPreciosItem"></param>
		/// <remarks></remarks>
		/// <returns>Returns a TList of PatItemInventario objects.</returns>
		public abstract TList<PatItemInventario> GetByIdListaPreciosItemFromPatItemInventarioListaPrecios(TransactionManager transactionManager,System.Byte _idListaPreciosItem, int start, int pageLength, out int count);
		
		#endregion GetByIdListaPreciosItemFromPatItemInventarioListaPrecios
		
		#region GetByIdOperacionFromPatItemOperacion
		
		/// <summary>
		///		Gets PAT_ITEM_INVENTARIO objects from the datasource by ID_OPERACION in the
		///		PAT_ITEM_OPERACION table. Table PAT_ITEM_INVENTARIO is related to table PAT_TEMPARIO
		///		through the (M:N) relationship defined in the PAT_ITEM_OPERACION table.
		/// </summary>
		/// <param name="_idOperacion"></param>
		/// <returns>Returns a typed collection of PatItemInventario objects.</returns>
		public TList<PatItemInventario> GetByIdOperacionFromPatItemOperacion(System.Int32 _idOperacion)
		{
			int count = -1;
			return GetByIdOperacionFromPatItemOperacion(null,_idOperacion, 0, int.MaxValue, out count);
			
		}
		
		/// <summary>
		///		Gets PAT.Entities.PatItemInventario objects from the datasource by ID_OPERACION in the
		///		PAT_ITEM_OPERACION table. Table PAT_ITEM_INVENTARIO is related to table PAT_TEMPARIO
		///		through the (M:N) relationship defined in the PAT_ITEM_OPERACION table.
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_idOperacion"></param>
		/// <remarks></remarks>
		/// <returns>Returns a TList of PatItemInventario objects.</returns>
		public TList<PatItemInventario> GetByIdOperacionFromPatItemOperacion(System.Int32 _idOperacion, int start, int pageLength)
		{
			int count = -1;
			return GetByIdOperacionFromPatItemOperacion(null, _idOperacion, start, pageLength, out count);
		}
		
		/// <summary>
		///		Gets PatItemInventario objects from the datasource by ID_OPERACION in the
		///		PAT_ITEM_OPERACION table. Table PAT_ITEM_INVENTARIO is related to table PAT_TEMPARIO
		///		through the (M:N) relationship defined in the PAT_ITEM_OPERACION table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idOperacion"></param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT_ITEM_INVENTARIO objects.</returns>
		public TList<PatItemInventario> GetByIdOperacionFromPatItemOperacion(TransactionManager transactionManager, System.Int32 _idOperacion)
		{
			int count = -1;
			return GetByIdOperacionFromPatItemOperacion(transactionManager, _idOperacion, 0, int.MaxValue, out count);
		}
		
		
		/// <summary>
		///		Gets PatItemInventario objects from the datasource by ID_OPERACION in the
		///		PAT_ITEM_OPERACION table. Table PAT_ITEM_INVENTARIO is related to table PAT_TEMPARIO
		///		through the (M:N) relationship defined in the PAT_ITEM_OPERACION table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idOperacion"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT_ITEM_INVENTARIO objects.</returns>
		public TList<PatItemInventario> GetByIdOperacionFromPatItemOperacion(TransactionManager transactionManager, System.Int32 _idOperacion,int start, int pageLength)
		{
			int count = -1;
			return GetByIdOperacionFromPatItemOperacion(transactionManager, _idOperacion, start, pageLength, out count);
		}
		
		/// <summary>
		///		Gets PatItemInventario objects from the datasource by ID_OPERACION in the
		///		PAT_ITEM_OPERACION table. Table PAT_ITEM_INVENTARIO is related to table PAT_TEMPARIO
		///		through the (M:N) relationship defined in the PAT_ITEM_OPERACION table.
		/// </summary>
		/// <param name="_idOperacion"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT_ITEM_INVENTARIO objects.</returns>
		public TList<PatItemInventario> GetByIdOperacionFromPatItemOperacion(System.Int32 _idOperacion,int start, int pageLength, out int count)
		{
			
			return GetByIdOperacionFromPatItemOperacion(null, _idOperacion, start, pageLength, out count);
		}


		/// <summary>
		///		Gets PAT_ITEM_INVENTARIO objects from the datasource by ID_OPERACION in the
		///		PAT_ITEM_OPERACION table. Table PAT_ITEM_INVENTARIO is related to table PAT_TEMPARIO
		///		through the (M:N) relationship defined in the PAT_ITEM_OPERACION table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <param name="_idOperacion"></param>
		/// <remarks></remarks>
		/// <returns>Returns a TList of PatItemInventario objects.</returns>
		public abstract TList<PatItemInventario> GetByIdOperacionFromPatItemOperacion(TransactionManager transactionManager,System.Int32 _idOperacion, int start, int pageLength, out int count);
		
		#endregion GetByIdOperacionFromPatItemOperacion
		
		#region GetByIdKitFromPatKitItem
		
		/// <summary>
		///		Gets PAT_ITEM_INVENTARIO objects from the datasource by ID_KIT in the
		///		PAT_KIT_ITEM table. Table PAT_ITEM_INVENTARIO is related to table PAT_KIT
		///		through the (M:N) relationship defined in the PAT_KIT_ITEM table.
		/// </summary>
		/// <param name="_idKit"></param>
		/// <returns>Returns a typed collection of PatItemInventario objects.</returns>
		public TList<PatItemInventario> GetByIdKitFromPatKitItem(System.Int32 _idKit)
		{
			int count = -1;
			return GetByIdKitFromPatKitItem(null,_idKit, 0, int.MaxValue, out count);
			
		}
		
		/// <summary>
		///		Gets PAT.Entities.PatItemInventario objects from the datasource by ID_KIT in the
		///		PAT_KIT_ITEM table. Table PAT_ITEM_INVENTARIO is related to table PAT_KIT
		///		through the (M:N) relationship defined in the PAT_KIT_ITEM table.
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_idKit"></param>
		/// <remarks></remarks>
		/// <returns>Returns a TList of PatItemInventario objects.</returns>
		public TList<PatItemInventario> GetByIdKitFromPatKitItem(System.Int32 _idKit, int start, int pageLength)
		{
			int count = -1;
			return GetByIdKitFromPatKitItem(null, _idKit, start, pageLength, out count);
		}
		
		/// <summary>
		///		Gets PatItemInventario objects from the datasource by ID_KIT in the
		///		PAT_KIT_ITEM table. Table PAT_ITEM_INVENTARIO is related to table PAT_KIT
		///		through the (M:N) relationship defined in the PAT_KIT_ITEM table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idKit"></param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT_ITEM_INVENTARIO objects.</returns>
		public TList<PatItemInventario> GetByIdKitFromPatKitItem(TransactionManager transactionManager, System.Int32 _idKit)
		{
			int count = -1;
			return GetByIdKitFromPatKitItem(transactionManager, _idKit, 0, int.MaxValue, out count);
		}
		
		
		/// <summary>
		///		Gets PatItemInventario objects from the datasource by ID_KIT in the
		///		PAT_KIT_ITEM table. Table PAT_ITEM_INVENTARIO is related to table PAT_KIT
		///		through the (M:N) relationship defined in the PAT_KIT_ITEM table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idKit"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT_ITEM_INVENTARIO objects.</returns>
		public TList<PatItemInventario> GetByIdKitFromPatKitItem(TransactionManager transactionManager, System.Int32 _idKit,int start, int pageLength)
		{
			int count = -1;
			return GetByIdKitFromPatKitItem(transactionManager, _idKit, start, pageLength, out count);
		}
		
		/// <summary>
		///		Gets PatItemInventario objects from the datasource by ID_KIT in the
		///		PAT_KIT_ITEM table. Table PAT_ITEM_INVENTARIO is related to table PAT_KIT
		///		through the (M:N) relationship defined in the PAT_KIT_ITEM table.
		/// </summary>
		/// <param name="_idKit"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT_ITEM_INVENTARIO objects.</returns>
		public TList<PatItemInventario> GetByIdKitFromPatKitItem(System.Int32 _idKit,int start, int pageLength, out int count)
		{
			
			return GetByIdKitFromPatKitItem(null, _idKit, start, pageLength, out count);
		}


		/// <summary>
		///		Gets PAT_ITEM_INVENTARIO objects from the datasource by ID_KIT in the
		///		PAT_KIT_ITEM table. Table PAT_ITEM_INVENTARIO is related to table PAT_KIT
		///		through the (M:N) relationship defined in the PAT_KIT_ITEM table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <param name="_idKit"></param>
		/// <remarks></remarks>
		/// <returns>Returns a TList of PatItemInventario objects.</returns>
		public abstract TList<PatItemInventario> GetByIdKitFromPatKitItem(TransactionManager transactionManager,System.Int32 _idKit, int start, int pageLength, out int count);
		
		#endregion GetByIdKitFromPatKitItem
		
		#region GetByIdDocumentoNumeroTransferenciaFromPatTransferenciaDetalle
		
		/// <summary>
		///		Gets PAT_ITEM_INVENTARIO objects from the datasource by ID_DOCUMENTO in the
		///		PAT_TRANSFERENCIA_DETALLE table. Table PAT_ITEM_INVENTARIO is related to table PAT_TRANSFERENCIA
		///		through the (M:N) relationship defined in the PAT_TRANSFERENCIA_DETALLE table.
		/// </summary>
		/// <param name="_idDocumento"></param>
		/// <param name="_numeroTransferencia"></param>
		/// <returns>Returns a typed collection of PatItemInventario objects.</returns>
		public TList<PatItemInventario> GetByIdDocumentoNumeroTransferenciaFromPatTransferenciaDetalle(System.Int32 _idDocumento, System.Int32 _numeroTransferencia)
		{
			int count = -1;
			return GetByIdDocumentoNumeroTransferenciaFromPatTransferenciaDetalle(null,_idDocumento, _numeroTransferencia, 0, int.MaxValue, out count);
			
		}
		
		/// <summary>
		///		Gets PAT.Entities.PatItemInventario objects from the datasource by ID_DOCUMENTO in the
		///		PAT_TRANSFERENCIA_DETALLE table. Table PAT_ITEM_INVENTARIO is related to table PAT_TRANSFERENCIA
		///		through the (M:N) relationship defined in the PAT_TRANSFERENCIA_DETALLE table.
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_idDocumento"></param>
		/// <param name="_numeroTransferencia"></param>
		/// <remarks></remarks>
		/// <returns>Returns a TList of PatItemInventario objects.</returns>
		public TList<PatItemInventario> GetByIdDocumentoNumeroTransferenciaFromPatTransferenciaDetalle(System.Int32 _idDocumento, System.Int32 _numeroTransferencia, int start, int pageLength)
		{
			int count = -1;
			return GetByIdDocumentoNumeroTransferenciaFromPatTransferenciaDetalle(null, _idDocumento, _numeroTransferencia, start, pageLength, out count);
		}
		
		/// <summary>
		///		Gets PatItemInventario objects from the datasource by ID_DOCUMENTO in the
		///		PAT_TRANSFERENCIA_DETALLE table. Table PAT_ITEM_INVENTARIO is related to table PAT_TRANSFERENCIA
		///		through the (M:N) relationship defined in the PAT_TRANSFERENCIA_DETALLE table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idDocumento"></param>
		/// <param name="_numeroTransferencia"></param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT_ITEM_INVENTARIO objects.</returns>
		public TList<PatItemInventario> GetByIdDocumentoNumeroTransferenciaFromPatTransferenciaDetalle(TransactionManager transactionManager, System.Int32 _idDocumento, System.Int32 _numeroTransferencia)
		{
			int count = -1;
			return GetByIdDocumentoNumeroTransferenciaFromPatTransferenciaDetalle(transactionManager, _idDocumento, _numeroTransferencia, 0, int.MaxValue, out count);
		}
		
		
		/// <summary>
		///		Gets PatItemInventario objects from the datasource by ID_DOCUMENTO in the
		///		PAT_TRANSFERENCIA_DETALLE table. Table PAT_ITEM_INVENTARIO is related to table PAT_TRANSFERENCIA
		///		through the (M:N) relationship defined in the PAT_TRANSFERENCIA_DETALLE table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idDocumento"></param>
		/// <param name="_numeroTransferencia"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT_ITEM_INVENTARIO objects.</returns>
		public TList<PatItemInventario> GetByIdDocumentoNumeroTransferenciaFromPatTransferenciaDetalle(TransactionManager transactionManager, System.Int32 _idDocumento, System.Int32 _numeroTransferencia,int start, int pageLength)
		{
			int count = -1;
			return GetByIdDocumentoNumeroTransferenciaFromPatTransferenciaDetalle(transactionManager, _idDocumento, _numeroTransferencia, start, pageLength, out count);
		}
		
		/// <summary>
		///		Gets PatItemInventario objects from the datasource by ID_DOCUMENTO in the
		///		PAT_TRANSFERENCIA_DETALLE table. Table PAT_ITEM_INVENTARIO is related to table PAT_TRANSFERENCIA
		///		through the (M:N) relationship defined in the PAT_TRANSFERENCIA_DETALLE table.
		/// </summary>
		/// <param name="_idDocumento"></param>
		/// <param name="_numeroTransferencia"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT_ITEM_INVENTARIO objects.</returns>
		public TList<PatItemInventario> GetByIdDocumentoNumeroTransferenciaFromPatTransferenciaDetalle(System.Int32 _idDocumento, System.Int32 _numeroTransferencia,int start, int pageLength, out int count)
		{
			
			return GetByIdDocumentoNumeroTransferenciaFromPatTransferenciaDetalle(null, _idDocumento, _numeroTransferencia, start, pageLength, out count);
		}


		/// <summary>
		///		Gets PAT_ITEM_INVENTARIO objects from the datasource by ID_DOCUMENTO in the
		///		PAT_TRANSFERENCIA_DETALLE table. Table PAT_ITEM_INVENTARIO is related to table PAT_TRANSFERENCIA
		///		through the (M:N) relationship defined in the PAT_TRANSFERENCIA_DETALLE table.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <param name="_idDocumento"></param>
		/// <param name="_numeroTransferencia"></param>
		/// <remarks></remarks>
		/// <returns>Returns a TList of PatItemInventario objects.</returns>
		public abstract TList<PatItemInventario> GetByIdDocumentoNumeroTransferenciaFromPatTransferenciaDetalle(TransactionManager transactionManager,System.Int32 _idDocumento, System.Int32 _numeroTransferencia, int start, int pageLength, out int count);
		
		#endregion GetByIdDocumentoNumeroTransferenciaFromPatTransferenciaDetalle
		
		#endregion	
		
		#region Delete Methods

		/// <summary>
		/// 	Deletes a row from the DataSource.
		/// </summary>
		/// <param name="transactionManager">A <see cref="TransactionManager"/> object.</param>
		/// <param name="key">The unique identifier of the row to delete.</param>
		/// <returns>Returns true if operation suceeded.</returns>
		public override bool Delete(TransactionManager transactionManager, PAT.Entities.PatItemInventarioKey key)
		{
			return Delete(transactionManager, key.IdItemInventario);
		}
		
		/// <summary>
		/// 	Deletes a row from the DataSource.
		/// </summary>
		/// <param name="_idItemInventario">. Primary Key.</param>
		/// <remarks>Deletes based on primary key(s).</remarks>
		/// <returns>Returns true if operation suceeded.</returns>
		public bool Delete(System.Int32 _idItemInventario)
		{
			return Delete(null, _idItemInventario);
		}
		
		/// <summary>
		/// 	Deletes a row from the DataSource.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idItemInventario">. Primary Key.</param>
		/// <remarks>Deletes based on primary key(s).</remarks>
		/// <returns>Returns true if operation suceeded.</returns>
		public abstract bool Delete(TransactionManager transactionManager, System.Int32 _idItemInventario);		
		
		#endregion Delete Methods
		
		#region Get By Foreign Key Functions
		#endregion

		#region Get By Index Functions
		
		/// <summary>
		/// 	Gets a row from the DataSource based on its primary key.
		/// </summary>
		/// <param name="transactionManager">A <see cref="TransactionManager"/> object.</param>
		/// <param name="key">The unique identifier of the row to retrieve.</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <returns>Returns an instance of the Entity class.</returns>
		public override PAT.Entities.PatItemInventario Get(TransactionManager transactionManager, PAT.Entities.PatItemInventarioKey key, int start, int pageLength)
		{
			return GetByIdItemInventario(transactionManager, key.IdItemInventario, start, pageLength);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the primary key PK_PAT_ITEM_INVENTARIO index.
		/// </summary>
		/// <param name="_idItemInventario"></param>
		/// <returns>Returns an instance of the <see cref="PAT.Entities.PatItemInventario"/> class.</returns>
		public PAT.Entities.PatItemInventario GetByIdItemInventario(System.Int32 _idItemInventario)
		{
			int count = -1;
			return GetByIdItemInventario(null,_idItemInventario, 0, int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the PK_PAT_ITEM_INVENTARIO index.
		/// </summary>
		/// <param name="_idItemInventario"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="PAT.Entities.PatItemInventario"/> class.</returns>
		public PAT.Entities.PatItemInventario GetByIdItemInventario(System.Int32 _idItemInventario, int start, int pageLength)
		{
			int count = -1;
			return GetByIdItemInventario(null, _idItemInventario, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the PK_PAT_ITEM_INVENTARIO index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idItemInventario"></param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="PAT.Entities.PatItemInventario"/> class.</returns>
		public PAT.Entities.PatItemInventario GetByIdItemInventario(TransactionManager transactionManager, System.Int32 _idItemInventario)
		{
			int count = -1;
			return GetByIdItemInventario(transactionManager, _idItemInventario, 0, int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the PK_PAT_ITEM_INVENTARIO index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idItemInventario"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="PAT.Entities.PatItemInventario"/> class.</returns>
		public PAT.Entities.PatItemInventario GetByIdItemInventario(TransactionManager transactionManager, System.Int32 _idItemInventario, int start, int pageLength)
		{
			int count = -1;
			return GetByIdItemInventario(transactionManager, _idItemInventario, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the PK_PAT_ITEM_INVENTARIO index.
		/// </summary>
		/// <param name="_idItemInventario"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="PAT.Entities.PatItemInventario"/> class.</returns>
		public PAT.Entities.PatItemInventario GetByIdItemInventario(System.Int32 _idItemInventario, int start, int pageLength, out int count)
		{
			return GetByIdItemInventario(null, _idItemInventario, start, pageLength, out count);
		}
		
				
		/// <summary>
		/// 	Gets rows from the datasource based on the PK_PAT_ITEM_INVENTARIO index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idItemInventario"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns an instance of the <see cref="PAT.Entities.PatItemInventario"/> class.</returns>
		public abstract PAT.Entities.PatItemInventario GetByIdItemInventario(TransactionManager transactionManager, System.Int32 _idItemInventario, int start, int pageLength, out int count);
						
		#endregion "Get By Index Functions"
	
		#region Custom Methods
		
		
		#region CUST_PAT_ITEM_INVENTARIO_GetUsoXVehiculo 
		
		/// <summary>
		///	This method wrap the 'CUST_PAT_ITEM_INVENTARIO_GetUsoXVehiculo' stored procedure. 
		/// </summary>
		/// <param name="idItemInventario"> A <c>System.Int32?</c> instance.</param>
		/// <param name="idCatalogo"> A <c>System.Int32?</c> instance.</param>
		/// <param name="idGrupoCatalogo"> A <c>System.Int32?</c> instance.</param>
		/// <remark>This method is generate from a stored procedure.</remark>
		/// <returns>A <see cref="DataSet"/> instance.</returns>
		public DataSet GetUsoXVehiculo(System.Int32? idItemInventario, System.Int32? idCatalogo, System.Int32? idGrupoCatalogo)
		{
			return GetUsoXVehiculo(null, 0, int.MaxValue , idItemInventario, idCatalogo, idGrupoCatalogo);
		}
		
		/// <summary>
		///	This method wrap the 'CUST_PAT_ITEM_INVENTARIO_GetUsoXVehiculo' stored procedure. 
		/// </summary>
		/// <param name="idItemInventario"> A <c>System.Int32?</c> instance.</param>
		/// <param name="idCatalogo"> A <c>System.Int32?</c> instance.</param>
		/// <param name="idGrupoCatalogo"> A <c>System.Int32?</c> instance.</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remark>This method is generate from a stored procedure.</remark>
		/// <returns>A <see cref="DataSet"/> instance.</returns>
		public DataSet GetUsoXVehiculo(int start, int pageLength, System.Int32? idItemInventario, System.Int32? idCatalogo, System.Int32? idGrupoCatalogo)
		{
			return GetUsoXVehiculo(null, start, pageLength , idItemInventario, idCatalogo, idGrupoCatalogo);
		}
				
		/// <summary>
		///	This method wrap the 'CUST_PAT_ITEM_INVENTARIO_GetUsoXVehiculo' stored procedure. 
		/// </summary>
		/// <param name="idItemInventario"> A <c>System.Int32?</c> instance.</param>
		/// <param name="idCatalogo"> A <c>System.Int32?</c> instance.</param>
		/// <param name="idGrupoCatalogo"> A <c>System.Int32?</c> instance.</param>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <remark>This method is generate from a stored procedure.</remark>
		/// <returns>A <see cref="DataSet"/> instance.</returns>
		public DataSet GetUsoXVehiculo(TransactionManager transactionManager, System.Int32? idItemInventario, System.Int32? idCatalogo, System.Int32? idGrupoCatalogo)
		{
			return GetUsoXVehiculo(transactionManager, 0, int.MaxValue , idItemInventario, idCatalogo, idGrupoCatalogo);
		}
		
		/// <summary>
		///	This method wrap the 'CUST_PAT_ITEM_INVENTARIO_GetUsoXVehiculo' stored procedure. 
		/// </summary>
		/// <param name="idItemInventario"> A <c>System.Int32?</c> instance.</param>
		/// <param name="idCatalogo"> A <c>System.Int32?</c> instance.</param>
		/// <param name="idGrupoCatalogo"> A <c>System.Int32?</c> instance.</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <remark>This method is generate from a stored procedure.</remark>
		/// <returns>A <see cref="DataSet"/> instance.</returns>
		public abstract DataSet GetUsoXVehiculo(TransactionManager transactionManager, int start, int pageLength , System.Int32? idItemInventario, System.Int32? idCatalogo, System.Int32? idGrupoCatalogo);
		
		#endregion
		
		#endregion

		#region Helper Functions	
		
		/// <summary>
		/// Fill a TList&lt;PatItemInventario&gt; From a DataReader.
		/// </summary>
		/// <param name="reader">Datareader</param>
		/// <param name="rows">The collection to fill</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">number of rows.</param>
		/// <returns>a <see cref="TList&lt;PatItemInventario&gt;"/></returns>
		public static TList<PatItemInventario> Fill(IDataReader reader, TList<PatItemInventario> rows, int start, int pageLength)
		{
			NetTiersProvider currentProvider = DataRepository.Provider;
            bool useEntityFactory = currentProvider.UseEntityFactory;
            bool enableEntityTracking = currentProvider.EnableEntityTracking;
            LoadPolicy currentLoadPolicy = currentProvider.CurrentLoadPolicy;
			Type entityCreationFactoryType = currentProvider.EntityCreationalFactoryType;
			
			// advance to the starting row
			for (int i = 0; i < start; i++)
			{
				if (!reader.Read())
				return rows; // not enough rows, just return
			}
			for (int i = 0; i < pageLength; i++)
			{
				if (!reader.Read())
					break; // we are done
					
				string key = null;
				
				PAT.Entities.PatItemInventario c = null;
				if (useEntityFactory)
				{
					key = new System.Text.StringBuilder("PatItemInventario")
					.Append("|").Append((System.Int32)reader[((int)PatItemInventarioColumn.IdItemInventario - 1)]).ToString();
					c = EntityManager.LocateOrCreate<PatItemInventario>(
					key.ToString(), // EntityTrackingKey
					"PatItemInventario",  //Creational Type
					entityCreationFactoryType,  //Factory used to create entity
					enableEntityTracking); // Track this entity?
				}
				else
				{
					c = new PAT.Entities.PatItemInventario();
				}
				
				if (!enableEntityTracking ||
					c.EntityState == EntityState.Added ||
					(enableEntityTracking &&
					
						(
							(currentLoadPolicy == LoadPolicy.PreserveChanges && c.EntityState == EntityState.Unchanged) ||
							(currentLoadPolicy == LoadPolicy.DiscardChanges && c.EntityState != EntityState.Unchanged)
						)
					))
				{
					c.SuppressEntityEvents = true;
					c.IdItemInventario = (System.Int32)reader[((int)PatItemInventarioColumn.IdItemInventario - 1)];
					c.CodigoInternoItem = (System.String)reader[((int)PatItemInventarioColumn.CodigoInternoItem - 1)];
					c.DescripcionItem = (System.String)reader[((int)PatItemInventarioColumn.DescripcionItem - 1)];
					c.LineaBodega = (System.String)reader[((int)PatItemInventarioColumn.LineaBodega - 1)];
					c.Arancel = (System.Decimal)reader[((int)PatItemInventarioColumn.Arancel - 1)];
					c.Marca = (System.String)reader[((int)PatItemInventarioColumn.Marca - 1)];
					c.Familia = (System.String)reader[((int)PatItemInventarioColumn.Familia - 1)];
					c.SubFamilia = (reader.IsDBNull(((int)PatItemInventarioColumn.SubFamilia - 1)))?null:(System.String)reader[((int)PatItemInventarioColumn.SubFamilia - 1)];
					c.Categoria = (reader.IsDBNull(((int)PatItemInventarioColumn.Categoria - 1)))?null:(System.String)reader[((int)PatItemInventarioColumn.Categoria - 1)];
					c.UnidadPor = (System.String)reader[((int)PatItemInventarioColumn.UnidadPor - 1)];
					c.LoteEmpaque = (System.Int32)reader[((int)PatItemInventarioColumn.LoteEmpaque - 1)];
					c.Volumen = (System.String)reader[((int)PatItemInventarioColumn.Volumen - 1)];
					c.Peso = (System.Decimal)reader[((int)PatItemInventarioColumn.Peso - 1)];
					c.PorcentajeDescuento = (System.Decimal)reader[((int)PatItemInventarioColumn.PorcentajeDescuento - 1)];
					c.PorcentajeIva = (System.Decimal)reader[((int)PatItemInventarioColumn.PorcentajeIva - 1)];
					c.CodigoAnteriorItem = (System.String)reader[((int)PatItemInventarioColumn.CodigoAnteriorItem - 1)];
					c.CodigoEquivalenteItem = (System.String)reader[((int)PatItemInventarioColumn.CodigoEquivalenteItem - 1)];
					c.Origen = (System.String)reader[((int)PatItemInventarioColumn.Origen - 1)];
					c.UsoXVehiculo = (System.Int16)reader[((int)PatItemInventarioColumn.UsoXVehiculo - 1)];
					c.StockMinimo = (System.Int16)reader[((int)PatItemInventarioColumn.StockMinimo - 1)];
					c.FechaCreacion = (System.DateTime)reader[((int)PatItemInventarioColumn.FechaCreacion - 1)];
					c.CostoReposicion = (System.Decimal)reader[((int)PatItemInventarioColumn.CostoReposicion - 1)];
					c.ItemGenerico = (System.Boolean)reader[((int)PatItemInventarioColumn.ItemGenerico - 1)];
					c.ClasificacionABc = (System.String)reader[((int)PatItemInventarioColumn.ClasificacionABc - 1)];
					c.Activo = (System.Boolean)reader[((int)PatItemInventarioColumn.Activo - 1)];
					c.EntityTrackingKey = key;
					c.AcceptChanges();
					c.SuppressEntityEvents = false;
				}
				rows.Add(c);
			}
		return rows;
		}		
		/// <summary>
		/// Refreshes the <see cref="PAT.Entities.PatItemInventario"/> object from the <see cref="IDataReader"/>.
		/// </summary>
		/// <param name="reader">The <see cref="IDataReader"/> to read from.</param>
		/// <param name="entity">The <see cref="PAT.Entities.PatItemInventario"/> object to refresh.</param>
		public static void RefreshEntity(IDataReader reader, PAT.Entities.PatItemInventario entity)
		{
			if (!reader.Read()) return;
			
			entity.IdItemInventario = (System.Int32)reader[((int)PatItemInventarioColumn.IdItemInventario - 1)];
			entity.CodigoInternoItem = (System.String)reader[((int)PatItemInventarioColumn.CodigoInternoItem - 1)];
			entity.DescripcionItem = (System.String)reader[((int)PatItemInventarioColumn.DescripcionItem - 1)];
			entity.LineaBodega = (System.String)reader[((int)PatItemInventarioColumn.LineaBodega - 1)];
			entity.Arancel = (System.Decimal)reader[((int)PatItemInventarioColumn.Arancel - 1)];
			entity.Marca = (System.String)reader[((int)PatItemInventarioColumn.Marca - 1)];
			entity.Familia = (System.String)reader[((int)PatItemInventarioColumn.Familia - 1)];
			entity.SubFamilia = (reader.IsDBNull(((int)PatItemInventarioColumn.SubFamilia - 1)))?null:(System.String)reader[((int)PatItemInventarioColumn.SubFamilia - 1)];
			entity.Categoria = (reader.IsDBNull(((int)PatItemInventarioColumn.Categoria - 1)))?null:(System.String)reader[((int)PatItemInventarioColumn.Categoria - 1)];
			entity.UnidadPor = (System.String)reader[((int)PatItemInventarioColumn.UnidadPor - 1)];
			entity.LoteEmpaque = (System.Int32)reader[((int)PatItemInventarioColumn.LoteEmpaque - 1)];
			entity.Volumen = (System.String)reader[((int)PatItemInventarioColumn.Volumen - 1)];
			entity.Peso = (System.Decimal)reader[((int)PatItemInventarioColumn.Peso - 1)];
			entity.PorcentajeDescuento = (System.Decimal)reader[((int)PatItemInventarioColumn.PorcentajeDescuento - 1)];
			entity.PorcentajeIva = (System.Decimal)reader[((int)PatItemInventarioColumn.PorcentajeIva - 1)];
			entity.CodigoAnteriorItem = (System.String)reader[((int)PatItemInventarioColumn.CodigoAnteriorItem - 1)];
			entity.CodigoEquivalenteItem = (System.String)reader[((int)PatItemInventarioColumn.CodigoEquivalenteItem - 1)];
			entity.Origen = (System.String)reader[((int)PatItemInventarioColumn.Origen - 1)];
			entity.UsoXVehiculo = (System.Int16)reader[((int)PatItemInventarioColumn.UsoXVehiculo - 1)];
			entity.StockMinimo = (System.Int16)reader[((int)PatItemInventarioColumn.StockMinimo - 1)];
			entity.FechaCreacion = (System.DateTime)reader[((int)PatItemInventarioColumn.FechaCreacion - 1)];
			entity.CostoReposicion = (System.Decimal)reader[((int)PatItemInventarioColumn.CostoReposicion - 1)];
			entity.ItemGenerico = (System.Boolean)reader[((int)PatItemInventarioColumn.ItemGenerico - 1)];
			entity.ClasificacionABc = (System.String)reader[((int)PatItemInventarioColumn.ClasificacionABc - 1)];
			entity.Activo = (System.Boolean)reader[((int)PatItemInventarioColumn.Activo - 1)];
			entity.AcceptChanges();
		}
		
		/// <summary>
		/// Refreshes the <see cref="PAT.Entities.PatItemInventario"/> object from the <see cref="DataSet"/>.
		/// </summary>
		/// <param name="dataSet">The <see cref="DataSet"/> to read from.</param>
		/// <param name="entity">The <see cref="PAT.Entities.PatItemInventario"/> object.</param>
		public static void RefreshEntity(DataSet dataSet, PAT.Entities.PatItemInventario entity)
		{
			DataRow dataRow = dataSet.Tables[0].Rows[0];
			
			entity.IdItemInventario = (System.Int32)dataRow["ID_ITEM_INVENTARIO"];
			entity.CodigoInternoItem = (System.String)dataRow["CODIGO_INTERNO_ITEM"];
			entity.DescripcionItem = (System.String)dataRow["DESCRIPCION_ITEM"];
			entity.LineaBodega = (System.String)dataRow["LINEA_BODEGA"];
			entity.Arancel = (System.Decimal)dataRow["ARANCEL"];
			entity.Marca = (System.String)dataRow["MARCA"];
			entity.Familia = (System.String)dataRow["FAMILIA"];
			entity.SubFamilia = Convert.IsDBNull(dataRow["SUB_FAMILIA"]) ? null : (System.String)dataRow["SUB_FAMILIA"];
			entity.Categoria = Convert.IsDBNull(dataRow["CATEGORIA"]) ? null : (System.String)dataRow["CATEGORIA"];
			entity.UnidadPor = (System.String)dataRow["UNIDAD_POR"];
			entity.LoteEmpaque = (System.Int32)dataRow["LOTE_EMPAQUE"];
			entity.Volumen = (System.String)dataRow["VOLUMEN"];
			entity.Peso = (System.Decimal)dataRow["PESO"];
			entity.PorcentajeDescuento = (System.Decimal)dataRow["PORCENTAJE_DESCUENTO"];
			entity.PorcentajeIva = (System.Decimal)dataRow["PORCENTAJE_IVA"];
			entity.CodigoAnteriorItem = (System.String)dataRow["CODIGO_ANTERIOR_ITEM"];
			entity.CodigoEquivalenteItem = (System.String)dataRow["CODIGO_EQUIVALENTE_ITEM"];
			entity.Origen = (System.String)dataRow["ORIGEN"];
			entity.UsoXVehiculo = (System.Int16)dataRow["USO_X_VEHICULO"];
			entity.StockMinimo = (System.Int16)dataRow["STOCK_MINIMO"];
			entity.FechaCreacion = (System.DateTime)dataRow["FECHA_CREACION"];
			entity.CostoReposicion = (System.Decimal)dataRow["COSTO_REPOSICION"];
			entity.ItemGenerico = (System.Boolean)dataRow["ITEM_GENERICO"];
			entity.ClasificacionABc = (System.String)dataRow["CLASIFICACION_aBC"];
			entity.Activo = (System.Boolean)dataRow["ACTIVO"];
			entity.AcceptChanges();
		}
		#endregion 
		
		#region DeepLoad Methods
		/// <summary>
		/// Deep Loads the <see cref="IEntity"/> object with criteria based of the child 
		/// property collections only N Levels Deep based on the <see cref="DeepLoadType"/>.
		/// </summary>
		/// <remarks>
		/// Use this method with caution as it is possible to DeepLoad with Recursion and traverse an entire object graph.
		/// </remarks>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="entity">The <see cref="PAT.Entities.PatItemInventario"/> object to load.</param>
		/// <param name="deep">Boolean. A flag that indicates whether to recursively save all Property Collection that are descendants of this instance. If True, saves the complete object graph below this object. If False, saves this object only. </param>
		/// <param name="deepLoadType">DeepLoadType Enumeration to Include/Exclude object property collections from Load.</param>
		/// <param name="childTypes">PAT.Entities.PatItemInventario Property Collection Type Array To Include or Exclude from Load</param>
		/// <param name="innerList">A collection of child types for easy access.</param>
	    /// <exception cref="ArgumentNullException">entity or childTypes is null.</exception>
	    /// <exception cref="ArgumentException">deepLoadType has invalid value.</exception>
		public override void DeepLoad(TransactionManager transactionManager, PAT.Entities.PatItemInventario entity, bool deep, DeepLoadType deepLoadType, System.Type[] childTypes, DeepSession innerList)
		{
			if(entity == null)
				return;
			
			//used to hold DeepLoad method delegates and fire after all the local children have been loaded.
			Dictionary<string, KeyValuePair<Delegate, object>> deepHandles = new Dictionary<string, KeyValuePair<Delegate, object>>();
			// Deep load child collections  - Call GetByIdItemInventario methods when available
			
			#region PatKitItemCollection
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<PatKitItem>|PatKitItemCollection", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'PatKitItemCollection' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.PatKitItemCollection = DataRepository.PatKitItemProvider.GetByIdItemInventario(transactionManager, entity.IdItemInventario);

				if (deep && entity.PatKitItemCollection.Count > 0)
				{
					deepHandles.Add("PatKitItemCollection",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<PatKitItem>) DataRepository.PatKitItemProvider.DeepLoad,
						new object[] { transactionManager, entity.PatKitItemCollection, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			#region PatItemOperacionCollection
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<PatItemOperacion>|PatItemOperacionCollection", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'PatItemOperacionCollection' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.PatItemOperacionCollection = DataRepository.PatItemOperacionProvider.GetByIdItemInventario(transactionManager, entity.IdItemInventario);

				if (deep && entity.PatItemOperacionCollection.Count > 0)
				{
					deepHandles.Add("PatItemOperacionCollection",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<PatItemOperacion>) DataRepository.PatItemOperacionProvider.DeepLoad,
						new object[] { transactionManager, entity.PatItemOperacionCollection, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			#region PatTransferenciaDetalleCollection
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<PatTransferenciaDetalle>|PatTransferenciaDetalleCollection", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'PatTransferenciaDetalleCollection' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.PatTransferenciaDetalleCollection = DataRepository.PatTransferenciaDetalleProvider.GetByIdItemInventario(transactionManager, entity.IdItemInventario);

				if (deep && entity.PatTransferenciaDetalleCollection.Count > 0)
				{
					deepHandles.Add("PatTransferenciaDetalleCollection",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<PatTransferenciaDetalle>) DataRepository.PatTransferenciaDetalleProvider.DeepLoad,
						new object[] { transactionManager, entity.PatTransferenciaDetalleCollection, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			#region PatItemGrupoCollection
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<PatItemGrupo>|PatItemGrupoCollection", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'PatItemGrupoCollection' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.PatItemGrupoCollection = DataRepository.PatItemGrupoProvider.GetByIdItemInventario(transactionManager, entity.IdItemInventario);

				if (deep && entity.PatItemGrupoCollection.Count > 0)
				{
					deepHandles.Add("PatItemGrupoCollection",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<PatItemGrupo>) DataRepository.PatItemGrupoProvider.DeepLoad,
						new object[] { transactionManager, entity.PatItemGrupoCollection, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			#region IdGrupoCatalogoPatGrupoCatalogoCollection_From_PatItemGrupo
			// RelationshipType.ManyToMany
			if (CanDeepLoad(entity, "List<PatGrupoCatalogo>|IdGrupoCatalogoPatGrupoCatalogoCollection_From_PatItemGrupo", deepLoadType, innerList))
			{
				entity.IdGrupoCatalogoPatGrupoCatalogoCollection_From_PatItemGrupo = DataRepository.PatGrupoCatalogoProvider.GetByIdItemInventarioFromPatItemGrupo(transactionManager, entity.IdItemInventario);			 
		
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'IdGrupoCatalogoPatGrupoCatalogoCollection_From_PatItemGrupo' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.IdGrupoCatalogoPatGrupoCatalogoCollection_From_PatItemGrupo != null)
				{
					deepHandles.Add("IdGrupoCatalogoPatGrupoCatalogoCollection_From_PatItemGrupo",
						new KeyValuePair<Delegate, object>((DeepLoadHandle< PatGrupoCatalogo >) DataRepository.PatGrupoCatalogoProvider.DeepLoad,
						new object[] { transactionManager, entity.IdGrupoCatalogoPatGrupoCatalogoCollection_From_PatItemGrupo, deep, deepLoadType, childTypes, innerList }
					));
				}
			}
			#endregion
			
			
			
			#region IdKitPatKitCollection_From_PatKitItem
			// RelationshipType.ManyToMany
			if (CanDeepLoad(entity, "List<PatKit>|IdKitPatKitCollection_From_PatKitItem", deepLoadType, innerList))
			{
				entity.IdKitPatKitCollection_From_PatKitItem = DataRepository.PatKitProvider.GetByIdItemInventarioFromPatKitItem(transactionManager, entity.IdItemInventario);			 
		
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'IdKitPatKitCollection_From_PatKitItem' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.IdKitPatKitCollection_From_PatKitItem != null)
				{
					deepHandles.Add("IdKitPatKitCollection_From_PatKitItem",
						new KeyValuePair<Delegate, object>((DeepLoadHandle< PatKit >) DataRepository.PatKitProvider.DeepLoad,
						new object[] { transactionManager, entity.IdKitPatKitCollection_From_PatKitItem, deep, deepLoadType, childTypes, innerList }
					));
				}
			}
			#endregion
			
			
			
			#region PatItemInventarioListaPreciosCollection
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<PatItemInventarioListaPrecios>|PatItemInventarioListaPreciosCollection", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'PatItemInventarioListaPreciosCollection' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.PatItemInventarioListaPreciosCollection = DataRepository.PatItemInventarioListaPreciosProvider.GetByIdItemInventario(transactionManager, entity.IdItemInventario);

				if (deep && entity.PatItemInventarioListaPreciosCollection.Count > 0)
				{
					deepHandles.Add("PatItemInventarioListaPreciosCollection",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<PatItemInventarioListaPrecios>) DataRepository.PatItemInventarioListaPreciosProvider.DeepLoad,
						new object[] { transactionManager, entity.PatItemInventarioListaPreciosCollection, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			#region IdCatalogoPatCatalogoVehiculoCollection_From_PatItemCatalogo
			// RelationshipType.ManyToMany
			if (CanDeepLoad(entity, "List<PatCatalogoVehiculo>|IdCatalogoPatCatalogoVehiculoCollection_From_PatItemCatalogo", deepLoadType, innerList))
			{
				entity.IdCatalogoPatCatalogoVehiculoCollection_From_PatItemCatalogo = DataRepository.PatCatalogoVehiculoProvider.GetByIdItemInventarioFromPatItemCatalogo(transactionManager, entity.IdItemInventario);			 
		
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'IdCatalogoPatCatalogoVehiculoCollection_From_PatItemCatalogo' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.IdCatalogoPatCatalogoVehiculoCollection_From_PatItemCatalogo != null)
				{
					deepHandles.Add("IdCatalogoPatCatalogoVehiculoCollection_From_PatItemCatalogo",
						new KeyValuePair<Delegate, object>((DeepLoadHandle< PatCatalogoVehiculo >) DataRepository.PatCatalogoVehiculoProvider.DeepLoad,
						new object[] { transactionManager, entity.IdCatalogoPatCatalogoVehiculoCollection_From_PatItemCatalogo, deep, deepLoadType, childTypes, innerList }
					));
				}
			}
			#endregion
			
			
			
			#region IdDocumentoNumeroTransferenciaPatTransferenciaCollection_From_PatTransferenciaDetalle
			// RelationshipType.ManyToMany
			if (CanDeepLoad(entity, "List<PatTransferencia>|IdDocumentoNumeroTransferenciaPatTransferenciaCollection_From_PatTransferenciaDetalle", deepLoadType, innerList))
			{
				entity.IdDocumentoNumeroTransferenciaPatTransferenciaCollection_From_PatTransferenciaDetalle = DataRepository.PatTransferenciaProvider.GetByIdItemInventarioFromPatTransferenciaDetalle(transactionManager, entity.IdItemInventario);			 
		
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'IdDocumentoNumeroTransferenciaPatTransferenciaCollection_From_PatTransferenciaDetalle' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.IdDocumentoNumeroTransferenciaPatTransferenciaCollection_From_PatTransferenciaDetalle != null)
				{
					deepHandles.Add("IdDocumentoNumeroTransferenciaPatTransferenciaCollection_From_PatTransferenciaDetalle",
						new KeyValuePair<Delegate, object>((DeepLoadHandle< PatTransferencia >) DataRepository.PatTransferenciaProvider.DeepLoad,
						new object[] { transactionManager, entity.IdDocumentoNumeroTransferenciaPatTransferenciaCollection_From_PatTransferenciaDetalle, deep, deepLoadType, childTypes, innerList }
					));
				}
			}
			#endregion
			
			
			
			#region IdListaPreciosItemPatItemListaPreciosCollection_From_PatItemInventarioListaPrecios
			// RelationshipType.ManyToMany
			if (CanDeepLoad(entity, "List<PatItemListaPrecios>|IdListaPreciosItemPatItemListaPreciosCollection_From_PatItemInventarioListaPrecios", deepLoadType, innerList))
			{
				entity.IdListaPreciosItemPatItemListaPreciosCollection_From_PatItemInventarioListaPrecios = DataRepository.PatItemListaPreciosProvider.GetByIdItemInventarioFromPatItemInventarioListaPrecios(transactionManager, entity.IdItemInventario);			 
		
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'IdListaPreciosItemPatItemListaPreciosCollection_From_PatItemInventarioListaPrecios' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.IdListaPreciosItemPatItemListaPreciosCollection_From_PatItemInventarioListaPrecios != null)
				{
					deepHandles.Add("IdListaPreciosItemPatItemListaPreciosCollection_From_PatItemInventarioListaPrecios",
						new KeyValuePair<Delegate, object>((DeepLoadHandle< PatItemListaPrecios >) DataRepository.PatItemListaPreciosProvider.DeepLoad,
						new object[] { transactionManager, entity.IdListaPreciosItemPatItemListaPreciosCollection_From_PatItemInventarioListaPrecios, deep, deepLoadType, childTypes, innerList }
					));
				}
			}
			#endregion
			
			
			
			#region IdOperacionPatTemparioCollection_From_PatItemOperacion
			// RelationshipType.ManyToMany
			if (CanDeepLoad(entity, "List<PatTempario>|IdOperacionPatTemparioCollection_From_PatItemOperacion", deepLoadType, innerList))
			{
				entity.IdOperacionPatTemparioCollection_From_PatItemOperacion = DataRepository.PatTemparioProvider.GetByIdItemInventarioFromPatItemOperacion(transactionManager, entity.IdItemInventario);			 
		
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'IdOperacionPatTemparioCollection_From_PatItemOperacion' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.IdOperacionPatTemparioCollection_From_PatItemOperacion != null)
				{
					deepHandles.Add("IdOperacionPatTemparioCollection_From_PatItemOperacion",
						new KeyValuePair<Delegate, object>((DeepLoadHandle< PatTempario >) DataRepository.PatTemparioProvider.DeepLoad,
						new object[] { transactionManager, entity.IdOperacionPatTemparioCollection_From_PatItemOperacion, deep, deepLoadType, childTypes, innerList }
					));
				}
			}
			#endregion
			
			
			
			#region PatItemCatalogoCollection
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<PatItemCatalogo>|PatItemCatalogoCollection", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'PatItemCatalogoCollection' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.PatItemCatalogoCollection = DataRepository.PatItemCatalogoProvider.GetByIdItemInventario(transactionManager, entity.IdItemInventario);

				if (deep && entity.PatItemCatalogoCollection.Count > 0)
				{
					deepHandles.Add("PatItemCatalogoCollection",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<PatItemCatalogo>) DataRepository.PatItemCatalogoProvider.DeepLoad,
						new object[] { transactionManager, entity.PatItemCatalogoCollection, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			//Fire all DeepLoad Items
			foreach(KeyValuePair<Delegate, object> pair in deepHandles.Values)
		    {
                pair.Key.DynamicInvoke((object[])pair.Value);
		    }
			deepHandles = null;
		}
		
		#endregion 
		
		#region DeepSave Methods

		/// <summary>
		/// Deep Save the entire object graph of the PAT.Entities.PatItemInventario object with criteria based of the child 
		/// Type property array and DeepSaveType.
		/// </summary>
		/// <param name="transactionManager">The transaction manager.</param>
		/// <param name="entity">PAT.Entities.PatItemInventario instance</param>
		/// <param name="deepSaveType">DeepSaveType Enumeration to Include/Exclude object property collections from Save.</param>
		/// <param name="childTypes">PAT.Entities.PatItemInventario Property Collection Type Array To Include or Exclude from Save</param>
		/// <param name="innerList">A Hashtable of child types for easy access.</param>
		public override bool DeepSave(TransactionManager transactionManager, PAT.Entities.PatItemInventario entity, DeepSaveType deepSaveType, System.Type[] childTypes, DeepSession innerList)
		{	
			if (entity == null)
				return false;
							
			#region Composite Parent Properties
			//Save Source Composite Properties, however, don't call deep save on them.  
			//So they only get saved a single level deep.
			#endregion Composite Parent Properties

			// Save Root Entity through Provider
			if (!entity.IsDeleted)
				this.Save(transactionManager, entity);
			
			//used to hold DeepSave method delegates and fire after all the local children have been saved.
			Dictionary<string, KeyValuePair<Delegate, object>> deepHandles = new Dictionary<string, KeyValuePair<Delegate, object>>();

			#region IdGrupoCatalogoPatGrupoCatalogoCollection_From_PatItemGrupo>
			if (CanDeepSave(entity.IdGrupoCatalogoPatGrupoCatalogoCollection_From_PatItemGrupo, "List<PatGrupoCatalogo>|IdGrupoCatalogoPatGrupoCatalogoCollection_From_PatItemGrupo", deepSaveType, innerList))
			{
				if (entity.IdGrupoCatalogoPatGrupoCatalogoCollection_From_PatItemGrupo.Count > 0 || entity.IdGrupoCatalogoPatGrupoCatalogoCollection_From_PatItemGrupo.DeletedItems.Count > 0)
				{
					DataRepository.PatGrupoCatalogoProvider.Save(transactionManager, entity.IdGrupoCatalogoPatGrupoCatalogoCollection_From_PatItemGrupo); 
					deepHandles.Add("IdGrupoCatalogoPatGrupoCatalogoCollection_From_PatItemGrupo",
						new KeyValuePair<Delegate, object>((DeepSaveHandle<PatGrupoCatalogo>) DataRepository.PatGrupoCatalogoProvider.DeepSave,
						new object[] { transactionManager, entity.IdGrupoCatalogoPatGrupoCatalogoCollection_From_PatItemGrupo, deepSaveType, childTypes, innerList }
					));
				}
			}
			#endregion 

			#region IdKitPatKitCollection_From_PatKitItem>
			if (CanDeepSave(entity.IdKitPatKitCollection_From_PatKitItem, "List<PatKit>|IdKitPatKitCollection_From_PatKitItem", deepSaveType, innerList))
			{
				if (entity.IdKitPatKitCollection_From_PatKitItem.Count > 0 || entity.IdKitPatKitCollection_From_PatKitItem.DeletedItems.Count > 0)
				{
					DataRepository.PatKitProvider.Save(transactionManager, entity.IdKitPatKitCollection_From_PatKitItem); 
					deepHandles.Add("IdKitPatKitCollection_From_PatKitItem",
						new KeyValuePair<Delegate, object>((DeepSaveHandle<PatKit>) DataRepository.PatKitProvider.DeepSave,
						new object[] { transactionManager, entity.IdKitPatKitCollection_From_PatKitItem, deepSaveType, childTypes, innerList }
					));
				}
			}
			#endregion 

			#region IdCatalogoPatCatalogoVehiculoCollection_From_PatItemCatalogo>
			if (CanDeepSave(entity.IdCatalogoPatCatalogoVehiculoCollection_From_PatItemCatalogo, "List<PatCatalogoVehiculo>|IdCatalogoPatCatalogoVehiculoCollection_From_PatItemCatalogo", deepSaveType, innerList))
			{
				if (entity.IdCatalogoPatCatalogoVehiculoCollection_From_PatItemCatalogo.Count > 0 || entity.IdCatalogoPatCatalogoVehiculoCollection_From_PatItemCatalogo.DeletedItems.Count > 0)
				{
					DataRepository.PatCatalogoVehiculoProvider.Save(transactionManager, entity.IdCatalogoPatCatalogoVehiculoCollection_From_PatItemCatalogo); 
					deepHandles.Add("IdCatalogoPatCatalogoVehiculoCollection_From_PatItemCatalogo",
						new KeyValuePair<Delegate, object>((DeepSaveHandle<PatCatalogoVehiculo>) DataRepository.PatCatalogoVehiculoProvider.DeepSave,
						new object[] { transactionManager, entity.IdCatalogoPatCatalogoVehiculoCollection_From_PatItemCatalogo, deepSaveType, childTypes, innerList }
					));
				}
			}
			#endregion 

			#region IdDocumentoNumeroTransferenciaPatTransferenciaCollection_From_PatTransferenciaDetalle>
			if (CanDeepSave(entity.IdDocumentoNumeroTransferenciaPatTransferenciaCollection_From_PatTransferenciaDetalle, "List<PatTransferencia>|IdDocumentoNumeroTransferenciaPatTransferenciaCollection_From_PatTransferenciaDetalle", deepSaveType, innerList))
			{
				if (entity.IdDocumentoNumeroTransferenciaPatTransferenciaCollection_From_PatTransferenciaDetalle.Count > 0 || entity.IdDocumentoNumeroTransferenciaPatTransferenciaCollection_From_PatTransferenciaDetalle.DeletedItems.Count > 0)
				{
					DataRepository.PatTransferenciaProvider.Save(transactionManager, entity.IdDocumentoNumeroTransferenciaPatTransferenciaCollection_From_PatTransferenciaDetalle); 
					deepHandles.Add("IdDocumentoNumeroTransferenciaPatTransferenciaCollection_From_PatTransferenciaDetalle",
						new KeyValuePair<Delegate, object>((DeepSaveHandle<PatTransferencia>) DataRepository.PatTransferenciaProvider.DeepSave,
						new object[] { transactionManager, entity.IdDocumentoNumeroTransferenciaPatTransferenciaCollection_From_PatTransferenciaDetalle, deepSaveType, childTypes, innerList }
					));
				}
			}
			#endregion 

			#region IdListaPreciosItemPatItemListaPreciosCollection_From_PatItemInventarioListaPrecios>
			if (CanDeepSave(entity.IdListaPreciosItemPatItemListaPreciosCollection_From_PatItemInventarioListaPrecios, "List<PatItemListaPrecios>|IdListaPreciosItemPatItemListaPreciosCollection_From_PatItemInventarioListaPrecios", deepSaveType, innerList))
			{
				if (entity.IdListaPreciosItemPatItemListaPreciosCollection_From_PatItemInventarioListaPrecios.Count > 0 || entity.IdListaPreciosItemPatItemListaPreciosCollection_From_PatItemInventarioListaPrecios.DeletedItems.Count > 0)
				{
					DataRepository.PatItemListaPreciosProvider.Save(transactionManager, entity.IdListaPreciosItemPatItemListaPreciosCollection_From_PatItemInventarioListaPrecios); 
					deepHandles.Add("IdListaPreciosItemPatItemListaPreciosCollection_From_PatItemInventarioListaPrecios",
						new KeyValuePair<Delegate, object>((DeepSaveHandle<PatItemListaPrecios>) DataRepository.PatItemListaPreciosProvider.DeepSave,
						new object[] { transactionManager, entity.IdListaPreciosItemPatItemListaPreciosCollection_From_PatItemInventarioListaPrecios, deepSaveType, childTypes, innerList }
					));
				}
			}
			#endregion 

			#region IdOperacionPatTemparioCollection_From_PatItemOperacion>
			if (CanDeepSave(entity.IdOperacionPatTemparioCollection_From_PatItemOperacion, "List<PatTempario>|IdOperacionPatTemparioCollection_From_PatItemOperacion", deepSaveType, innerList))
			{
				if (entity.IdOperacionPatTemparioCollection_From_PatItemOperacion.Count > 0 || entity.IdOperacionPatTemparioCollection_From_PatItemOperacion.DeletedItems.Count > 0)
				{
					DataRepository.PatTemparioProvider.Save(transactionManager, entity.IdOperacionPatTemparioCollection_From_PatItemOperacion); 
					deepHandles.Add("IdOperacionPatTemparioCollection_From_PatItemOperacion",
						new KeyValuePair<Delegate, object>((DeepSaveHandle<PatTempario>) DataRepository.PatTemparioProvider.DeepSave,
						new object[] { transactionManager, entity.IdOperacionPatTemparioCollection_From_PatItemOperacion, deepSaveType, childTypes, innerList }
					));
				}
			}
			#endregion 
	
			#region List<PatKitItem>
				if (CanDeepSave(entity.PatKitItemCollection, "List<PatKitItem>|PatKitItemCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(PatKitItem child in entity.PatKitItemCollection)
					{
						if(child.IdItemInventarioSource != null)
						{
								child.IdItemInventario = child.IdItemInventarioSource.IdItemInventario;
						}

						if(child.IdKitSource != null)
						{
								child.IdKit = child.IdKitSource.IdKit;
						}

					}

					if (entity.PatKitItemCollection.Count > 0 || entity.PatKitItemCollection.DeletedItems.Count > 0)
					{
						//DataRepository.PatKitItemProvider.Save(transactionManager, entity.PatKitItemCollection);
						
						deepHandles.Add("PatKitItemCollection",
						new KeyValuePair<Delegate, object>((DeepSaveHandle< PatKitItem >) DataRepository.PatKitItemProvider.DeepSave,
							new object[] { transactionManager, entity.PatKitItemCollection, deepSaveType, childTypes, innerList }
						));
					}
				} 
			#endregion 
				
	
			#region List<PatItemOperacion>
				if (CanDeepSave(entity.PatItemOperacionCollection, "List<PatItemOperacion>|PatItemOperacionCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(PatItemOperacion child in entity.PatItemOperacionCollection)
					{
						if(child.IdItemInventarioSource != null)
						{
								child.IdItemInventario = child.IdItemInventarioSource.IdItemInventario;
						}

						if(child.IdOperacionSource != null)
						{
								child.IdOperacion = child.IdOperacionSource.IdOperacion;
						}

					}

					if (entity.PatItemOperacionCollection.Count > 0 || entity.PatItemOperacionCollection.DeletedItems.Count > 0)
					{
						//DataRepository.PatItemOperacionProvider.Save(transactionManager, entity.PatItemOperacionCollection);
						
						deepHandles.Add("PatItemOperacionCollection",
						new KeyValuePair<Delegate, object>((DeepSaveHandle< PatItemOperacion >) DataRepository.PatItemOperacionProvider.DeepSave,
							new object[] { transactionManager, entity.PatItemOperacionCollection, deepSaveType, childTypes, innerList }
						));
					}
				} 
			#endregion 
				
	
			#region List<PatTransferenciaDetalle>
				if (CanDeepSave(entity.PatTransferenciaDetalleCollection, "List<PatTransferenciaDetalle>|PatTransferenciaDetalleCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(PatTransferenciaDetalle child in entity.PatTransferenciaDetalleCollection)
					{
						if(child.IdItemInventarioSource != null)
						{
								child.IdItemInventario = child.IdItemInventarioSource.IdItemInventario;
						}

						if(child.IdDocumentoNumeroTransferenciaSource != null)
						{
								child.IdDocumento = child.IdDocumentoNumeroTransferenciaSource.IdDocumento;
								child.NumeroTransferencia = child.IdDocumentoNumeroTransferenciaSource.NumeroTransferencia;
						}

					}

					if (entity.PatTransferenciaDetalleCollection.Count > 0 || entity.PatTransferenciaDetalleCollection.DeletedItems.Count > 0)
					{
						//DataRepository.PatTransferenciaDetalleProvider.Save(transactionManager, entity.PatTransferenciaDetalleCollection);
						
						deepHandles.Add("PatTransferenciaDetalleCollection",
						new KeyValuePair<Delegate, object>((DeepSaveHandle< PatTransferenciaDetalle >) DataRepository.PatTransferenciaDetalleProvider.DeepSave,
							new object[] { transactionManager, entity.PatTransferenciaDetalleCollection, deepSaveType, childTypes, innerList }
						));
					}
				} 
			#endregion 
				
	
			#region List<PatItemGrupo>
				if (CanDeepSave(entity.PatItemGrupoCollection, "List<PatItemGrupo>|PatItemGrupoCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(PatItemGrupo child in entity.PatItemGrupoCollection)
					{
						if(child.IdItemInventarioSource != null)
						{
								child.IdItemInventario = child.IdItemInventarioSource.IdItemInventario;
						}

						if(child.IdGrupoCatalogoSource != null)
						{
								child.IdGrupoCatalogo = child.IdGrupoCatalogoSource.IdGrupoCatalogo;
						}

					}

					if (entity.PatItemGrupoCollection.Count > 0 || entity.PatItemGrupoCollection.DeletedItems.Count > 0)
					{
						//DataRepository.PatItemGrupoProvider.Save(transactionManager, entity.PatItemGrupoCollection);
						
						deepHandles.Add("PatItemGrupoCollection",
						new KeyValuePair<Delegate, object>((DeepSaveHandle< PatItemGrupo >) DataRepository.PatItemGrupoProvider.DeepSave,
							new object[] { transactionManager, entity.PatItemGrupoCollection, deepSaveType, childTypes, innerList }
						));
					}
				} 
			#endregion 
				
	
			#region List<PatItemInventarioListaPrecios>
				if (CanDeepSave(entity.PatItemInventarioListaPreciosCollection, "List<PatItemInventarioListaPrecios>|PatItemInventarioListaPreciosCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(PatItemInventarioListaPrecios child in entity.PatItemInventarioListaPreciosCollection)
					{
						if(child.IdItemInventarioSource != null)
						{
								child.IdItemInventario = child.IdItemInventarioSource.IdItemInventario;
						}

						if(child.IdListaPreciosItemSource != null)
						{
								child.IdListaPreciosItem = child.IdListaPreciosItemSource.IdItemListaPrecio;
						}

					}

					if (entity.PatItemInventarioListaPreciosCollection.Count > 0 || entity.PatItemInventarioListaPreciosCollection.DeletedItems.Count > 0)
					{
						//DataRepository.PatItemInventarioListaPreciosProvider.Save(transactionManager, entity.PatItemInventarioListaPreciosCollection);
						
						deepHandles.Add("PatItemInventarioListaPreciosCollection",
						new KeyValuePair<Delegate, object>((DeepSaveHandle< PatItemInventarioListaPrecios >) DataRepository.PatItemInventarioListaPreciosProvider.DeepSave,
							new object[] { transactionManager, entity.PatItemInventarioListaPreciosCollection, deepSaveType, childTypes, innerList }
						));
					}
				} 
			#endregion 
				
	
			#region List<PatItemCatalogo>
				if (CanDeepSave(entity.PatItemCatalogoCollection, "List<PatItemCatalogo>|PatItemCatalogoCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(PatItemCatalogo child in entity.PatItemCatalogoCollection)
					{
						if(child.IdItemInventarioSource != null)
						{
								child.IdItemInventario = child.IdItemInventarioSource.IdItemInventario;
						}

						if(child.IdCatalogoSource != null)
						{
								child.IdCatalogo = child.IdCatalogoSource.IdCatalogo;
						}

					}

					if (entity.PatItemCatalogoCollection.Count > 0 || entity.PatItemCatalogoCollection.DeletedItems.Count > 0)
					{
						//DataRepository.PatItemCatalogoProvider.Save(transactionManager, entity.PatItemCatalogoCollection);
						
						deepHandles.Add("PatItemCatalogoCollection",
						new KeyValuePair<Delegate, object>((DeepSaveHandle< PatItemCatalogo >) DataRepository.PatItemCatalogoProvider.DeepSave,
							new object[] { transactionManager, entity.PatItemCatalogoCollection, deepSaveType, childTypes, innerList }
						));
					}
				} 
			#endregion 
				
			//Fire all DeepSave Items
			foreach(KeyValuePair<Delegate, object> pair in deepHandles.Values)
		    {
                pair.Key.DynamicInvoke((object[])pair.Value);
		    }
			
			// Save Root Entity through Provider, if not already saved in delete mode
			if (entity.IsDeleted)
				this.Save(transactionManager, entity);
				

			deepHandles = null;
						
			return true;
		}
		#endregion
	} // end class
	
	#region PatItemInventarioChildEntityTypes
	
	///<summary>
	/// Enumeration used to expose the different child entity types 
	/// for child properties in <c>PAT.Entities.PatItemInventario</c>
	///</summary>
	public enum PatItemInventarioChildEntityTypes
	{

		///<summary>
		/// Collection of <c>PatItemInventario</c> as OneToMany for PatKitItemCollection
		///</summary>
		[ChildEntityType(typeof(TList<PatKitItem>))]
		PatKitItemCollection,

		///<summary>
		/// Collection of <c>PatItemInventario</c> as OneToMany for PatItemOperacionCollection
		///</summary>
		[ChildEntityType(typeof(TList<PatItemOperacion>))]
		PatItemOperacionCollection,

		///<summary>
		/// Collection of <c>PatItemInventario</c> as OneToMany for PatTransferenciaDetalleCollection
		///</summary>
		[ChildEntityType(typeof(TList<PatTransferenciaDetalle>))]
		PatTransferenciaDetalleCollection,

		///<summary>
		/// Collection of <c>PatItemInventario</c> as OneToMany for PatItemGrupoCollection
		///</summary>
		[ChildEntityType(typeof(TList<PatItemGrupo>))]
		PatItemGrupoCollection,

		///<summary>
		/// Collection of <c>PatItemInventario</c> as ManyToMany for PatGrupoCatalogoCollection_From_PatItemGrupo
		///</summary>
		[ChildEntityType(typeof(TList<PatGrupoCatalogo>))]
		IdGrupoCatalogoPatGrupoCatalogoCollection_From_PatItemGrupo,

		///<summary>
		/// Collection of <c>PatItemInventario</c> as ManyToMany for PatKitCollection_From_PatKitItem
		///</summary>
		[ChildEntityType(typeof(TList<PatKit>))]
		IdKitPatKitCollection_From_PatKitItem,

		///<summary>
		/// Collection of <c>PatItemInventario</c> as OneToMany for PatItemInventarioListaPreciosCollection
		///</summary>
		[ChildEntityType(typeof(TList<PatItemInventarioListaPrecios>))]
		PatItemInventarioListaPreciosCollection,

		///<summary>
		/// Collection of <c>PatItemInventario</c> as ManyToMany for PatCatalogoVehiculoCollection_From_PatItemCatalogo
		///</summary>
		[ChildEntityType(typeof(TList<PatCatalogoVehiculo>))]
		IdCatalogoPatCatalogoVehiculoCollection_From_PatItemCatalogo,

		///<summary>
		/// Collection of <c>PatItemInventario</c> as ManyToMany for PatTransferenciaCollection_From_PatTransferenciaDetalle
		///</summary>
		[ChildEntityType(typeof(TList<PatTransferencia>))]
		IdDocumentoNumeroTransferenciaPatTransferenciaCollection_From_PatTransferenciaDetalle,

		///<summary>
		/// Collection of <c>PatItemInventario</c> as ManyToMany for PatItemListaPreciosCollection_From_PatItemInventarioListaPrecios
		///</summary>
		[ChildEntityType(typeof(TList<PatItemListaPrecios>))]
		IdListaPreciosItemPatItemListaPreciosCollection_From_PatItemInventarioListaPrecios,

		///<summary>
		/// Collection of <c>PatItemInventario</c> as ManyToMany for PatTemparioCollection_From_PatItemOperacion
		///</summary>
		[ChildEntityType(typeof(TList<PatTempario>))]
		IdOperacionPatTemparioCollection_From_PatItemOperacion,

		///<summary>
		/// Collection of <c>PatItemInventario</c> as OneToMany for PatItemCatalogoCollection
		///</summary>
		[ChildEntityType(typeof(TList<PatItemCatalogo>))]
		PatItemCatalogoCollection,
	}
	
	#endregion PatItemInventarioChildEntityTypes
	
	#region PatItemInventarioFilterBuilder
	
	/// <summary>
	/// A strongly-typed instance of the <see cref="SqlFilterBuilder&lt;PatItemInventarioColumn&gt;"/> class
	/// that is used exclusively with a <see cref="PatItemInventario"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class PatItemInventarioFilterBuilder : SqlFilterBuilder<PatItemInventarioColumn>
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the PatItemInventarioFilterBuilder class.
		/// </summary>
		public PatItemInventarioFilterBuilder() : base() { }

		/// <summary>
		/// Initializes a new instance of the PatItemInventarioFilterBuilder class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		public PatItemInventarioFilterBuilder(bool ignoreCase) : base(ignoreCase) { }

		/// <summary>
		/// Initializes a new instance of the PatItemInventarioFilterBuilder class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		/// <param name="useAnd">Specifies whether to combine statements using AND or OR.</param>
		public PatItemInventarioFilterBuilder(bool ignoreCase, bool useAnd) : base(ignoreCase, useAnd) { }

		#endregion Constructors
	}

	#endregion PatItemInventarioFilterBuilder
	
	#region PatItemInventarioParameterBuilder
	
	/// <summary>
	/// A strongly-typed instance of the <see cref="ParameterizedSqlFilterBuilder&lt;PatItemInventarioColumn&gt;"/> class
	/// that is used exclusively with a <see cref="PatItemInventario"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class PatItemInventarioParameterBuilder : ParameterizedSqlFilterBuilder<PatItemInventarioColumn>
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the PatItemInventarioParameterBuilder class.
		/// </summary>
		public PatItemInventarioParameterBuilder() : base() { }

		/// <summary>
		/// Initializes a new instance of the PatItemInventarioParameterBuilder class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		public PatItemInventarioParameterBuilder(bool ignoreCase) : base(ignoreCase) { }

		/// <summary>
		/// Initializes a new instance of the PatItemInventarioParameterBuilder class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		/// <param name="useAnd">Specifies whether to combine statements using AND or OR.</param>
		public PatItemInventarioParameterBuilder(bool ignoreCase, bool useAnd) : base(ignoreCase, useAnd) { }

		#endregion Constructors
	}

	#endregion PatItemInventarioParameterBuilder
	
	#region PatItemInventarioSortBuilder
    
    /// <summary>
    /// A strongly-typed instance of the <see cref="SqlSortBuilder&lt;PatItemInventarioColumn&gt;"/> class
	/// that is used exclusively with a <see cref="PatItemInventario"/> object.
    /// </summary>
    [CLSCompliant(true)]
    public class PatItemInventarioSortBuilder : SqlSortBuilder<PatItemInventarioColumn>
    {
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the PatItemInventarioSqlSortBuilder class.
		/// </summary>
		public PatItemInventarioSortBuilder() : base() { }

		#endregion Constructors

    }    
    #endregion PatItemInventarioSortBuilder
	
} // end namespace
